package org.alex.samples.model;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "exam_user_subject")
public class ExamUserSubject implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1257879555530782554L;
	
	@Id
	@ManyToOne(cascade = {CascadeType.DETACH, CascadeType.PERSIST, CascadeType.MERGE})
	@JoinColumn(name = "user_id",insertable = false,updatable = false)
	private User user;
	
	@Id
	@ManyToOne(cascade = {CascadeType.DETACH, CascadeType.PERSIST, CascadeType.MERGE})
	@JoinColumn(name = "sub_id",insertable = false,updatable = false)
	private Subject subject;
	
	
	
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Subject getSubject() {
		return subject;
	}

	public void setSubject(Subject subject) {
		this.subject = subject;
	}

	

	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	
	
	
}
